
def tag(name, *content, cls=None, **attrs):
    '''生成一个或者多个html标签'''
    if cls is not None:
        attrs['class'] = cls
    
    if attrs:
        attr_str = ' '.join(' %s="%s"' % (attr, value) for attr, value in sorted(attrs.items()))
    else:
        attr_str = ''
    
    if content:
        return '\n'.join('<%s%s>%s</%s>' % (name, attr_str, c, name) for c in content)
    else:
        return '<%s%s />' % (name, attr_str)

print(tag('br'))
print(tag('p','hello','wangbo', cls='Ryzen', modle=1200))


def func(a, b=2, *numbers, last=4, **kw):
    pass

print(func.__defaults__)
print(func.__kwdefaults__)


from inspect import signature
sig = signature(func)
print(str(sig))

for name, param in sig.parameters.items():
    print(param.kind, ':', name, param.default)

